package com.koron.order.maintain.bean.convertor;

import com.koron.bean.standard.jobStock.maintain.dto.MaintainItemDTO;
import com.koron.bean.standard.jobStock.maintain.po.MaintainItemParams;
import com.koron.order.common.bean.po.OrderDispatch;
import com.koron.order.common.bean.po.OrderExecute;
import com.koron.order.maintain.bean.dto.MaintainDetailDto;
import com.koron.order.maintain.bean.dto.MaintainDispatchDto;
import com.koron.order.maintain.bean.entity.MaintainItemParamsPo;
import com.koron.order.maintain.bean.entity.MaintainItemPo;
import com.koron.order.maintain.bean.entity.MaintainPo;
import com.koron.order.maintain.bean.vo.MaintainDetailVo;
import com.koron.order.maintain.bean.vo.MaintainDispatchVo;
import com.koron.order.maintain.bean.vo.MaintainExecuteInfoVo;
import com.koron.order.maintain.bean.vo.MaintainItemVo;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

@Mapper(componentModel = "spring")
public interface MaintainConvertor {

    MaintainPo voToBean(MaintainDetailVo vo);

    MaintainPo dtoToBean(MaintainDetailDto vo);

    OrderDispatch voToBean(MaintainDispatchVo vo);

    OrderDispatch dtoToBean(MaintainDispatchDto vo);

    MaintainDispatchVo beanToVo(OrderDispatch bean);

    MaintainDetailVo beanToMaintainDetailVo(MaintainPo bean);

    @Mappings({
            @Mapping(target = "id", source = "orderExecuteId")
    })
    OrderExecute voToOrderExecuteVo(MaintainExecuteInfoVo vo);

    MaintainItemPo voToMaintainItemBean(MaintainItemVo vo);

    @Mappings({
            @Mapping(target = "standardItemId", source = "id"),
            @Mapping(target = "parentId", source = "parentId")

    })
    MaintainItemPo dtoToBean(MaintainItemDTO dto);

    @Mappings({
            @Mapping(target = "standardParamId", source = "id")
    })
    MaintainItemParamsPo beanToBean(MaintainItemParams v);
}
